<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org">

  <title>min</title>
  <link href="../cppreference.css" rel="stylesheet" type="text/css">
</head>

<body>
<table>
  <tr>
  <td>
  <div class="body-content">

  <div class="header-box">
    <a href="../index.html">cppreference.com</a> &gt; <a href=
    "index.html">C++ Algorithms</a> &gt; <a href="min.html">min</a>
  </div>

  <div class="name-format">
    min
  </div>

  <div class="syntax-name-format">
    Syntax:
  </div>
  <pre class="syntax-box">
  #include &lt;algorithm&gt;
  const <a href="../containers.html">TYPE</a>&amp; min( const <a href=
"../containers.html">TYPE</a>&amp; x, const <a href=
"../containers.html">TYPE</a>&amp; y );
  const <a href="../containers.html">TYPE</a>&amp; min( const <a href=
"../containers.html">TYPE</a>&amp; x, const <a href=
"../containers.html">TYPE</a>&amp; y, BinPred p );
</pre>

  <p>The min() function, unsurprisingly, returns the smaller of
  <em>x</em> and <em>y</em>.</p>

  <p>By default, the &lt; operator is used to compare the two elements.
  If the binary predicate <em>p</em> is given, it will be used
  instead.</p>

  <div class="related-name-format">
    Related topics:
  </div>

  <div class="related-content">
    <a href="max.html">max</a><br>
    <a href="max_element.html">max_element</a><br>
    <a href="min_element.html">min_element</a>
  </div>
  </div>
  </td>
  


  </tr>
  </table>
</body></html>
